package org.springblade.modules.repair.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.modules.repair.service.ElevatorPrincipalUserService;
import org.springblade.modules.repair.vo.UserBaseInfoVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 电梯责任人管理
 * @Author ysq
 * @Date 2023/2/14
 **/
@RestController
@AllArgsConstructor
@RequestMapping("repair/elevator/principal/user")
@Api(value = "电梯责任人", tags = "电梯责任人管理")
public class ElevatorPrincipalUserController extends BladeController {

	private final ElevatorPrincipalUserService elevatorPrincipalUserService;

	/**
	 * 根据电梯查询责任人
	 */
	@GetMapping("/detailByElevatorId")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "根据电梯查询责任人")
	public R<List<UserBaseInfoVO>> detailByElevatorId(@RequestParam Long elevatorId) {
		List<UserBaseInfoVO> list = elevatorPrincipalUserService.detailByElevatorId(elevatorId);
		return R.data(list);
	}
}
